﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace S_Gridding.Infrastructure
{
    /// <summary>
    /// 基础数据的仓储接口
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IRepository<T> where T : class,new()
    {
        /// <summary>
        /// 底层添加信息
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task<int> AddAsync(T t);

        /// <summary>
        /// 底层单个真删除
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task<int> DeleteAsync(T t);

        /// <summary>
        /// 底层修改信息
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task<int> UpdateAsync(T t);

        /// <summary>
        /// 底层反填  根据主键找到对应的单个对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<T> GetFindAsync(int id);
    }
}
